package indi.zhifa.study2025.class004.imgserv.entity.dto;

import indi.zhifa.study2025.class004.imgserv.enums.EPictureBelongTag;
import lombok.Data;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;

@Data
public class PictureRequest {
    String extUrl;
    String suffix;
    EPictureBelongTag belongTag;

    public void determineSuffix() {
        if(!StringUtils.hasText(suffix)) {
            if(StringUtils.hasText(extUrl)) {
                suffix = StringUtils.getFilenameExtension(extUrl);
            }
        }
    }

}
